package com.shop.front.vo.pink;

import com.alibaba.fastjson.annotation.JSONField;
import com.shop.jpa.domain.BaseDomain;
import com.shop.common.enums.pink.JishouStatusEnum;
import com.shop.util.IdSignUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@ApiModel("PinkJishouVo 拼团寄售")
@Data
public class PinkJishouVo extends BaseDomain implements Serializable {

    @ApiModelProperty(value = "id", hidden = true)
	@Id
    @Column(name = "id")
    @JSONField(serialize = false)
    private Long id;

    /**
	 * 用户 id
	 */
    @ApiModelProperty("用户 id")
	@Column(name = "uid")
    @JSONField(serialize = false)
    private Long uid;

    /**
	 * 拼团ID
	 */
    @ApiModelProperty("拼团ID")
	@Column(name = "pink_id")
    @JSONField(serialize = false)
    private Long pinkId;

    /**
     * 拼团记录id
     */
    @ApiModelProperty("拼团记录id")
    @Column(name = "store_pink_id")
    @JSONField(serialize = false)
    private Long storePinkId;

    /**
     * 地址id
     */
    @ApiModelProperty("地址id")
    @Column(name = "user_address_id")
    @JSONField(serialize = false)
    private Long userAddressId;

    /**
	 * 寄售状态0寄售中1提货 2 已完成
	 */
    @ApiModelProperty("寄售状态 0寄售中 1提货 2 已完成")
	@Column(name = "status")
    private Integer status;

    /**
	 * 寄售金额
	 */
    @ApiModelProperty("寄售金额")
	@Column(name = "jishou_money")
    private BigDecimal jishouMoney;

    /**
	 * 订单id
	 */
    @ApiModelProperty("订单id")
	@Column(name = "order_no")
    private String orderNo;

    /**
	 * 商品ID
	 */
    @ApiModelProperty("商品ID")
	@Column(name = "product_id")
    @JSONField(serialize = false)
    private Long productId;

    /**
	 * 商品规格ID
	 */
    @ApiModelProperty("商品规格ID")
	@Column(name = "product_attr_value_id")
    @JSONField(serialize = false)
    private Long productAttrValueId;

    /**
	 * 创建时间
	 */
    @ApiModelProperty("创建时间")
	@Column(name = "create_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 商品规格
     */
    @ApiModelProperty("规格")
    @Column(name = "suk")
    private String suk;

    /**
     * 商品名称
     */
    @ApiModelProperty("商品名称")
    @Column(name = "store_name")
    private String storeName;

    /**
     * 图片
     */
    @ApiModelProperty("图片")
    @Column(name = "image")
    private String image;

    @ApiModelProperty("状态")
    @Transient
    private String statusStr;
    public String getStatusStr() {
        return JishouStatusEnum.val(this.status).getName();
    }

    @ApiModelProperty("拼团记录ID")
    @Transient
    private String storePinkSign;
    public String getStorePinkSign() {
        return IdSignUtil.doSign(this.getStorePinkId());
    }

    @ApiModelProperty("收货地址ID")
    @Transient
    private String userAddressSign;
    public String getUserAddressSign() {
        return IdSignUtil.doSign(this.userAddressId);
    }

}